<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="author" content="lijinbo" />
    <title>126-css三角形实现</title>
    <style>
      div {
        margin: 16px;
      }
      .triangle {
        width: 0;
        height: 0;
        border-right: 10px solid transparent;
        border-left: 10px solid transparent;
        border-bottom: 10px solid #000;
        transition: 0.3s;
      }
      .triangle_top {
        transform: rotate(0);
      }

      .triangle_down {
        transform: rotate(180deg);
      }

      .triangle_left {
        transform: rotate(-90deg);
      }

      .triangle_right {
        transform: rotate(90deg);
      }
    </style>
  </head>

  <body>
    <div class="triangle triangle_top"></div>
    <div class="triangle triangle_down"></div>
    <div class="triangle triangle_left"></div>
    <div class="triangle triangle_right"></div>
  </body>
</html>
